<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

require '..\lib\dbConnection.php';

$editAuthor = false;

$strFirstName = $_POST['txtAuthorFirstName'];
$strMiddleName = $_POST['txtAuthorMiddleName'];
$strLastName = $_POST['txtAuthorLastName'];
$intCurrentUser = $_POST['intUserID'];
$intAuthorID = $_POST['intAuthorID'];

if(($strFirstName!="") && ($strLastName!=""))
{
    $editAuthor = mysql_query("CALL sp_EditAuthor('" . $intAuthorID . "', '" . $strFirstName . "', '" . $strMiddleName . "', '" . $strLastName . "', " . (int)$intCurrentUser . ")");
}

if ($editAuthor)
{
    mysql_close($dbConnection);
    header("Location:ref_addAuthor.php");
}
else
{
    echo mysql_error();
    mysql_close($dbConnection);
}
?>
